num = 100

for i in range(1, num + 1):
    if i % 7 == 0  or str(i).count('7')>0:
        print(i, end=" ")


for i in range(1, num + 1):
    if i % 7 == 0  or '7' in str(i):
        print(i, end=" ")
